package com.brite.android.game;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.brite.android.game.menu.MainMenu;

public class Wellcome extends Activity {
	public static final String PREFS_NAME = "FireBallHunter";
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        
        final Animation a = AnimationUtils
				.loadAnimation(this, R.anim.translate);
		a.reset();
		final ImageView splashScreen = (ImageView) findViewById(R.id.splashBackground);
		splashScreen.startAnimation(a);
		a.setAnimationListener(new AnimationListener() {
			
			@Override
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onAnimationEnd(Animation animation) {
				// TODO After finish Animation translate startActivity call
				startActivity(new Intent(Wellcome.this, MainMenu.class));
				finish();
			}
		});
		LinearLayout layout = (LinearLayout) findViewById(R.id.root);
		layout.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startActivity(new Intent(Wellcome.this, MainMenu.class));
				finish();
			}
		});
    }
}